package ru.nlezhnev.utils;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5 {
	static public String hashBinary(byte[] source) {
		try {
			MessageDigest m = MessageDigest.getInstance("MD5");
			m.update(source);
			BigInteger i = new BigInteger(1, m.digest());
			return String.format("%1$032x", i);			
		} catch (NoSuchAlgorithmException e) {
		}
		return "";
	}
}
